TARGETS = mutex_list app_spinlock
all: $(TARGETS)

CPP = g++
CPPFLAGS = -std=c++11 -g
LIBS = -lpthread

%.o : %.cpp
	$(CPP) $(CPPFLAGS) -c $< -o $@

mutex_list: mutex_list.o
	$(CPP) $^ -o mutex_list $(LIBS)
app_spinlock: app_spinlock.o
	$(CPP) $^ -o app_spinlock $(LIBS)

.PHONY: clean
clean:
	rm -rf *.o $(TARGETS) 